package com.cyy.api.controller;


import cn.dev33.satoken.annotation.SaCheckLogin;
import com.cyy.common.domain.Response;
import com.cyy.common.service.ArticleLikeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "文章点赞-API", description = "文章点赞-API")
@RestController
@RequestMapping("/v1/article-like")
@RequiredArgsConstructor
public class ApiArticleLikeController {

    private final ArticleLikeService articleLikeService;

    @Operation(description = "文章点赞")
    @GetMapping("/{id}")
    @SaCheckLogin
    public Response pageDto(@PathVariable("id") Integer id) {
        articleLikeService.like(id);
        return Response.success();
    }
}
